<template>
  <div class="content content51" v-show="initFlag">
    <el-checkbox v-model="form.beamLimitingDeviceXRay.isTest" :true-label="1" :false-label="0">稳定性检测不检测此类项目</el-checkbox>
    <div v-show="!form.beamLimitingDeviceXRay.isTest">
      <div class="innertitle">
        1．X射线限束装置<span style="font-weight: normal;">（布点图见图1）</span>
      </div>
      <div>
        在M区域内，<i>$R_0$</i>=<el-input v-model="form.beamLimitingDeviceXRay.r_0" class="input-line" />cm；屏蔽材料厚度：<el-input v-model="form.beamLimitingDeviceXRay.thickness" class="input-line" />mmPb，体模：固体水。NTD=<el-input v-model="form.beamLimitingDeviceXRay.ntd" class="input-line" />cm
      </div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td rowspan="3">检测点编号</td>
          <template v-for="tbodyIndex in beamLimitingDeviceXRay.table.tbody">
            <td colspan="2">
              <div class="multipleInput">
                <div>标称能量档：<el-input v-model="form.beamLimitingDeviceXRay['energy_'+tbodyIndex]" class="input-line" />Emean：<el-input v-model="form.beamLimitingDeviceXRay['e_mean_'+tbodyIndex]" class="input-line" /></div>
                <div>在体模中最大吸收剂量深度：<el-input v-model="form.beamLimitingDeviceXRay['depth_'+tbodyIndex]" class="input-line" /></div>
              </div>
            </td>
          </template>
        </tr>
        <tr>
          <template v-for="tbodyIndex in beamLimitingDeviceXRay.table.tbody">
            <td><el-checkbox v-model="form.beamLimitingDeviceXRay['system_X_'+tbodyIndex]" :true-label="1" :false-label="0">X限束装置完全打开Y限束装置完全关闭情况下Ei（mGy）</el-checkbox></td>
            <td><el-checkbox v-model="form.beamLimitingDeviceXRay['system_Y_'+tbodyIndex]" :true-label="1" :false-label="0">Y限束装置完全打开X限束装置完全关闭情况下Ei（mGy）</el-checkbox></td>
          </template>
        </tr>
        <tr>
          <template v-for="tbodyIndex in beamLimitingDeviceXRay.table.tbody">
            <td colspan="2"><el-checkbox v-model="form.beamLimitingDeviceXRay['minCase_'+tbodyIndex]" :true-label="1" :false-label="0">限束装置正方形<i>$cm^2$</i>，多元限束装置最小情况下Ei</el-checkbox></td>
          </template>
        </tr>
        <tr v-for="trIndex in beamLimitingDeviceXRay.table.tr" :key="trIndex">
          <td>{{trIndex}}</td>
          <template v-for="tbodyIndex in beamLimitingDeviceXRay.table.tbody">
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_X_'+tbodyIndex+'_'+trIndex]" class="input-line" /></td>
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_Y_'+tbodyIndex+'_'+trIndex]" class="input-line" /></td>
          </template>
        </tr>
        <tr>
          <td><i>$E_{aver}$</i></td>
          <template v-for="tbodyIndex in beamLimitingDeviceXRay.table.tbody">
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_X_'+tbodyIndex+'_E_aver']" class="input-line" /></td>
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_Y_'+tbodyIndex+'_E_aver']" class="input-line" /></td>
          </template>
        </tr>
        <tr>
          <td><i>$E_{max}$</i></td>
          <template v-for="tbodyIndex in beamLimitingDeviceXRay.table.tbody">
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_X_'+tbodyIndex+'_E_max']" class="input-line" /></td>
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_Y_'+tbodyIndex+'_E_max']" class="input-line" /></td>
          </template>
        </tr>
        <tr>
          <td>最大比值(%)</td>
          <template v-for="tbodyIndex in beamLimitingDeviceXRay.table.tbody">
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_X_'+tbodyIndex+'_max']" class="input-line" /></td>
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_Y_'+tbodyIndex+'_max']" class="input-line" /></td>
          </template>
        </tr>
        <tr>
          <td>平均比值(%)</td>
          <template v-for="tbodyIndex in beamLimitingDeviceXRay.table.tbody">
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_X_'+tbodyIndex+'_aver']" class="input-line" /></td>
            <td><el-input v-model="form.beamLimitingDeviceXRay['value_Y_'+tbodyIndex+'_aver']" class="input-line" /></td>
          </template>
        </tr>
      </table>
      <div class="innertitle">
        2．电子线限束装置<span style="font-weight: normal;">（布点图见图2）</span>
      </div>
      <div>体模：10mm厚固体水；NTD=<el-input v-model="form.electronBeamLimitingDevice.ntd" class="input-line" />cm。</div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td rowspan="3">检测点编号</td>
          <template v-for="tbodyIndex in electronBeamLimitingDevice.table.tbody">
            <td colspan="4">
              <div class="multipleInput">
                <div>标称能量档：<el-input v-model="form.electronBeamLimitingDevice['energy_'+tbodyIndex]" class="input-line" />Emean：<el-input v-model="form.electronBeamLimitingDevice['e_mean_'+tbodyIndex]" class="input-line" /></div>
                <div>在体模中最大吸收剂量深度：<el-input v-model="form.electronBeamLimitingDevice['depth_'+tbodyIndex]" class="input-line" /></div>
              </div>
            </td>
          </template>
        </tr>
        <tr>
          <template v-for="tbodyIndex in electronBeamLimitingDevice.table.tbody">
            <td colspan="4">
              限光筒尺寸
            </td>
          </template>
        </tr>
        <tr>
          <template v-for="tbodyIndex in electronBeamLimitingDevice.table.tbody">
            <td v-for="tdIndex in electronBeamLimitingDevice.table.td" :key="'td'+tbodyIndex+tdIndex">测量值<br/>（mGy）</td>
          </template>
        </tr>
        <tr v-for="trIndex in electronBeamLimitingDevice.table.tr" :key="trIndex">
          <td>{{trIndex}}</td>
          <template v-for="tbodyIndex in electronBeamLimitingDevice.table.tbody">
            <td v-for="tdIndex in electronBeamLimitingDevice.table.td" :key="'td'+tbodyIndex+tdIndex"><el-input v-model="form.electronBeamLimitingDevice['value_'+tbodyIndex+'_'+tdIndex+'_'+trIndex]" class="input-line" /></td>
          </template>
        </tr>
        <tr>
          <td>
            <i>$E_{aver}$</i>
          </td>
          <template v-for="tbodyIndex in electronBeamLimitingDevice.table.tbody">
            <td v-for="tdIndex in electronBeamLimitingDevice.table.td" :key="'td'+tbodyIndex+tdIndex"><el-input v-model="form.electronBeamLimitingDevice['value_'+tbodyIndex+'_'+tdIndex+'_E_aver']" class="input-line" /></td>
          </template>
        </tr>
        <tr>
          <td>
            <i>$E_{max}$</i>
          </td>
          <template v-for="tbodyIndex in electronBeamLimitingDevice.table.tbody">
            <td v-for="tdIndex in electronBeamLimitingDevice.table.td" :key="'td'+tbodyIndex+tdIndex"><el-input v-model="form.electronBeamLimitingDevice['value_'+tbodyIndex+'_'+tdIndex+'_E_max']" class="input-line" /></td>
          </template>
        </tr>
        <tr>
          <td>
            <i>最大比值(%)</i>
          </td>
          <template v-for="tbodyIndex in electronBeamLimitingDevice.table.tbody">
            <td v-for="tdIndex in electronBeamLimitingDevice.table.td" :key="'td'+tbodyIndex+tdIndex"><el-input v-model="form.electronBeamLimitingDevice['value_'+tbodyIndex+'_'+tdIndex+'_max']" class="input-line" /></td>
          </template>
        </tr>
        <tr>
          <td>
            <i>平均比值(%)</i>
          </td>
          <template v-for="tbodyIndex in electronBeamLimitingDevice.table.tbody">
            <td v-for="tdIndex in electronBeamLimitingDevice.table.td" :key="'td'+tbodyIndex+tdIndex"><el-input v-model="form.electronBeamLimitingDevice['value_'+tbodyIndex+'_'+tdIndex+'_aver']" class="input-line" /></td>
          </template>
        </tr>
      </table>
      <div class="innertitle">
        3．患者平面的泄漏辐射<span style="font-weight: normal;">（布点图见图3）</span>
      </div>
      <div>体模：固体水；NTD=<el-input v-model="form.leakageRadiation.ntd" class="input-line" />cm。</div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td rowspan="2">检测点编号</td>
          <template v-for="tbodyIndex in leakageRadiation.table.tbody">
            <td>
              <div class="multipleInput">
                <div>标称能量档：<el-input v-model="form.leakageRadiation['energy_irradiation_'+tbodyIndex]" class="input-line" />Emean：<el-input v-model="form.leakageRadiation['e_mean_irradiation_'+tbodyIndex]" class="input-line" /></div>
              </div>
            </td>
          </template>
          <td>
            <div class="multipleInput">
              <div>标称能量档：<el-input v-model="form.leakageRadiation.energy_limit" class="input-line" />Emean：<el-input v-model="form.leakageRadiation.e_mean_limit" class="input-line" /></div>
            </div>
          </td>
        </tr>
        <tr>
          <template v-for="tbodyIndex in leakageRadiation.table.tbody">
            <td>
              <div class="multipleInput">
                照射野：<el-input v-model="form.leakageRadiation['irradiation_'+tbodyIndex]" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div class="multipleInput">
              限光筒：<el-input v-model="form.leakageRadiation.limit" class="input-line" />
            </div>
          </td>
        </tr>
        <tr v-for="trIndex in leakageRadiation.table.tr" :key="trIndex">
          <td>{{trIndex}}</td>
          <template v-for="tbodyIndex in leakageRadiation.table.tbody">
            <td>
              <div>
                <el-input v-model="form.leakageRadiation['value_irradiation_'+tbodyIndex+'_'+trIndex]" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div>
              <el-input v-model="form.leakageRadiation['value_limit_'+trIndex]" class="input-line" />
            </div>
          </td>
        </tr>
        <tr>
          <td><i>$E_{aver}$</i></td>
          <template v-for="tbodyIndex in leakageRadiation.table.tbody">
            <td>
              <div>
                <el-input v-model="form.leakageRadiation['value_irradiation_'+tbodyIndex+'_E_aver']" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div>
              <el-input v-model="form.leakageRadiation.value_limit_E_aver" class="input-line" />
            </div>
          </td>
        </tr>
        <tr>
          <td><i>$E_{max}$</i></td>
          <template v-for="tbodyIndex in leakageRadiation.table.tbody">
            <td>
              <div>
                <el-input v-model="form.leakageRadiation['value_irradiation_'+tbodyIndex+'_E_max']" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div>
              <el-input v-model="form.leakageRadiation.value_limit_E_max" class="input-line" />
            </div>
          </td>
        </tr>
        <tr>
          <td>最大比值(%)</td>
          <template v-for="tbodyIndex in leakageRadiation.table.tbody">
            <td>
              <div>
                <el-input v-model="form.leakageRadiation['value_irradiation_'+tbodyIndex+'_max']" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div>
              <el-input v-model="form.leakageRadiation.value_limit_max" class="input-line" />
            </div>
          </td>
        </tr>
        <tr>
          <td>平均比值(%)</td>
          <template v-for="tbodyIndex in leakageRadiation.table.tbody">
            <td>
              <div>
                <el-input v-model="form.leakageRadiation['value_irradiation_'+tbodyIndex+'_aver']" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div>
              <el-input v-model="form.leakageRadiation.value_limit_aver" class="input-line" />
            </div>
          </td>
        </tr>
      </table>
      <div class="innertitle">
        4．患者平面外侧的泄漏辐射<span style="font-weight: normal;">（布点图见图4）</span>
      </div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td rowspan="2">检测点编号</td>
          <template v-for="tbodyIndex in leakageRadiationOutside.table.tbody">
            <td>
              <div class="multipleInput">
                <div>标称能量档：<el-input v-model="form.leakageRadiationOutside['energy_irradiation_'+tbodyIndex]" class="input-line" />Emean：<el-input v-model="form.leakageRadiationOutside['e_mean_irradiation_'+tbodyIndex]" class="input-line" /></div>
              </div>
            </td>
          </template>
          <td>
            <div class="multipleInput">
              <div>标称能量档：<el-input v-model="form.leakageRadiationOutside.energy_limit" class="input-line" />Emean：<el-input v-model="form.leakageRadiationOutside.e_mean_limit" class="input-line" /></div>
            </div>
          </td>
        </tr>
        <tr>
          <template v-for="tbodyIndex in leakageRadiationOutside.table.tbody">
            <td>
              <div class="multipleInput">
                照射野：<el-input v-model="form.leakageRadiationOutside['irradiation_'+tbodyIndex]" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div class="multipleInput">
              限光筒：<el-input v-model="form.leakageRadiationOutside.limit" class="input-line" />
            </div>
          </td>
        </tr>
        <tr v-for="trIndex in leakageRadiationOutside.table.tr" :key="trIndex">
          <td><el-input v-model="form.leakageRadiationOutside['serialNumber_'+trIndex]" class="input-line" /></td>
          <template v-for="tbodyIndex in leakageRadiationOutside.table.tbody">
            <td>
              <div>
                <el-input v-model="form.leakageRadiationOutside['value_irradiation_'+tbodyIndex+'_'+trIndex]" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div>
              <el-input v-model="form.leakageRadiationOutside['value_limit_'+trIndex]" class="input-line" />
            </div>
          </td>
        </tr>
        <tr>
          <td><i>$E_{max}$</i></td>
          <template v-for="tbodyIndex in leakageRadiationOutside.table.tbody">
            <td>
              <div>
                <el-input v-model="form.leakageRadiationOutside['value_irradiation_'+tbodyIndex+'_E_max']" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div>
              <el-input v-model="form.leakageRadiationOutside.value_limit_E_max" class="input-line" />
            </div>
          </td>
        </tr>
        <tr>
          <td>最大比值(%)</td>
          <template v-for="tbodyIndex in leakageRadiationOutside.table.tbody">
            <td>
              <div>
                <el-input v-model="form.leakageRadiationOutside['value_irradiation_'+tbodyIndex+'_max']" class="input-line" />
              </div>
            </td>
          </template>
          <td>
            <div>
              <el-input v-model="form.leakageRadiationOutside.value_limit_max" class="input-line" />
            </div>
          </td>
        </tr>
      </table>
      <div class="latex">
        公式：<i>$E_{ave} = \frac {1}{24} \Sigma ^{24}_{i=1}E_i,E_{max}$</i>为一组检测数值中最大值。
      </div>
      <div>
        <i>$最大比值=E_{max}/E_{mean}×100\%；平均比值=E_{ave}/E_{mean}×100\%$</i>
      </div>
      <div class="innertitle">
        5．在终止照射后感生放射性检测 (<span style="font-weight: normal;"><el-checkbox v-model="form.radioactivityTesting.isTest" :true-label="1" :false-label="0">无＞10MeV电子能量档的加速器不检测此项目</el-checkbox>)</span>
      </div>
      <div v-show="!form.radioactivityTesting.isTest">
        <div>
          每次进行4Gy的测量，间隙10min的方式运行4小时后，在最后一次照射后终止后的10s开始测量。
        </div>
        <table border="1" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td rowspan="3">检测点编号</td>
            <td :colspan="radioactivityTesting.table.td.length *2" class="multipleInput">
              <div>标称能量档：<el-input v-model="form.radioactivityTesting.energy_irradiation" class="input-line" />照射野：<el-input v-model="form.radioactivityTesting.irradiation" class="input-line" />剂量率：<el-input v-model="form.radioactivityTesting.doseRate_irradiation" class="input-line" /></div>
            </td>
            <td :colspan="radioactivityTesting.table.td.length *2" class="multipleInput">
              <div>标称能量档：<el-input v-model="form.radioactivityTesting.energy_limit" class="input-line" />限光筒：<el-input v-model="form.radioactivityTesting.limit" class="input-line" />剂量率：<el-input v-model="form.radioactivityTesting.doseRate_limit" class="input-line" /></div>
            </td>
          </tr>
          <tr>
            <template v-for="index in radioactivityTesting.table.tbody.length">
              <td :colspan="radioactivityTesting.table.td.length">5min内的累积量</td>
              <td :colspan="radioactivityTesting.table.td.length">≤3min内的剂量率</td>
            </template>
          </tr>
          <tr>
            <template v-for="(tbdoyItem,tbodyIndex) in radioactivityTesting.table.tbody">
              <template v-for="(tdItem,tdIndex) in radioactivityTesting.table.td">
                <td>离外壳{{tdItem}}cm处/μSv</td>
              </template>
            </template>
            <template v-for="(tbdoyItem,tbodyIndex) in radioactivityTesting.table.tbody">
              <template v-for="(tdItem,tdIndex) in radioactivityTesting.table.td">
                <td>离外壳{{tdItem}}cm处/μSv</td>
              </template>
            </template>
          </tr>
          <tr v-for="trIndex in radioactivityTesting.table.tr" :key="trIndex">
            <td>{{trIndex}}</td>
            <template v-for="(tbdoyItem,tbodyIndex) in radioactivityTesting.table.tbody">
              <template v-for="(tdItem,tdIndex) in radioactivityTesting.table.td">
                <td><el-input v-model="form.radioactivityTesting['value_irradiation_'+tbdoyItem+'_'+tdItem+'_'+trIndex]" class="input-line" /></td>
              </template>
            </template>
            <template v-for="(tbdoyItem,tbodyIndex) in radioactivityTesting.table.tbody">
              <template v-for="(tdItem,tdIndex) in radioactivityTesting.table.td">
                <td><el-input v-model="form.radioactivityTesting['value_limit_'+tbdoyItem+'_'+tdItem+'_'+trIndex]" class="input-line" /></td>
              </template>
            </template>
          </tr>
        </table>
        <div>注：分别检测X线能量档和电线能量档的最大档。</div>
        <div>布点图见图5。</div>
      </div>

      <div style="width: 100%;display: flex;align-items: center;flex-direction: column;">
        <img style="width: 450px;" src="@/assets/images/test_item80/tab3_form1_img.png" alt="">
        <div class="innertitle">图1  M区域内X射线限束装置漏射线布点图</div>
      </div>
      <div style="width: 100%;display: flex;align-items: center;flex-direction: column;">
        <img style="width: 450px;" src="@/assets/images/test_item80/tab3_form2_img.png" alt="">
        <div class="innertitle">图2  M区域内电子线限束装置漏射线布点图</div>
      </div>
      <div class="innertitle">中子本底值</div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td>编号</td>
          <td v-for="tdIndex in neutronBackground.table.td" :key="tdIndex">{{tdIndex}}</td>
          <td>平均值</td>
          <td>备注</td>
        </tr>
        <tr>
          <td>1</td>
          <td v-for="tdIndex in neutronBackground.table.td" :key="tdIndex"><el-input v-model="form.neutronBackground['value_'+tdIndex]" class="input-line" /></td>
          <td><el-input v-model="form.neutronBackground.average" class="input-line" /></td>
          <td><el-input v-model="form.neutronBackground.notes" class="input-line" /></td>
        </tr>
      </table>
      <div class="innertitle">热释光片本底值</div>
      <table border="1" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td>编号</td>
          <td v-for="tdIndex in thermoluminescentBackground.table.td" :key="tdIndex">{{tdIndex}}</td>
          <td>平均值</td>
          <td>备注</td>
        </tr>
        <tr v-for="trIndex in thermoluminescentBackground.table.tr" :key="trIndex">
          <td>{{trIndex}}</td>
          <td v-for="tdIndex in thermoluminescentBackground.table.td" :key="tdIndex"><el-input v-model="form.thermoluminescentBackground['value_'+trIndex+'_'+tdIndex]" class="input-line" /></td>
          <td><el-input v-model="form.thermoluminescentBackground['value_'+trIndex+'_aver']" class="input-line" /></td>
          <td><el-input v-model="form.thermoluminescentBackground['value_'+trIndex+'_notes']" class="input-line" /></td>
        </tr>
      </table>
      <div>布点图说明：</div>
      <el-input type="textarea" v-model="form.thermoluminescentBackground.explain"></el-input>
      <div style="width: 100%;display: flex;align-items: center;flex-direction: column;">
        <img style="width: 450px;" src="@/assets/images/test_item80/tab3_form3_img.png" alt="">
        <div class="innertitle">图3  M区域外平均泄漏辐射的24个测量点布点图</div>
      </div>
      <div style="width: 100%;display: flex;align-items: center;flex-direction: column;">
        <img style="width: 450px;" src="@/assets/images/test_item80/tab3_form4_img.png" alt="">
        <div class="innertitle">图4  患者平面测试区外侧泄漏辐射测量点布点图</div>
      </div>
      <div style="width: 100%;display: flex;align-items: center;flex-direction: column;" v-show="!form.radioactivityTesting.isTest">
        <img style="width: 450px;" src="@/assets/images/test_item80/tab3_form5_img.png" alt="">
        <div class="innertitle">图5  终止照射后感生放射性测量点布点图</div>
      </div>
    </div>

  </div>
</template>

<script>
  import {getInfoById, postInfo} from '@/api/testItem/item51';
  export default{
    name:'leakageRadiationDetectionResults',
    props: {
    	// tab栏
      activeTab: {
    		type: String,
        default: "0",
      },
    	// 基本信息数据
      basicForm: {
    		type: Object,
        default: () => {
    			return {}
    		},
      },
    },
    data(){
      return{
        initFlag:false,
        beamLimitingDeviceXRay:{
          action:'beamLimitingDeviceXRay',
          flag:true,
          loading:false,
          notNumber:['isTest','system_X_1','system_X_2','system_Y_1','system_Y_2','minCase_1','minCase_2'],
          intNumber:[],
          like:false,
          table:{
            tbody:2,
            tr:24
          }
        },
        electronBeamLimitingDevice:{
          action:'electronBeamLimitingDevice',
          flag:true,
          loading:false,
          notNumber:[],
          intNumber:[],
          like:false,
          table:{
            tbody:2,
            tr:24,
            td:4
          }
        },
        leakageRadiation:{
          action:'leakageRadiation',
          flag:true,
          loading:false,
          notNumber:['irradiation_1','limit','irradiation_2'],
          intNumber:[],
          like:false,
          table:{
            tbody:2,
            tr:24
          }
        },
        leakageRadiationOutside:{
          action:'leakageRadiationOutside',
          flag:true,
          loading:false,
          notNumber:['irradiation_1','irradiation_2','limit'],
          intNumber:['serialNumber'],
          like:true,
          table:{
            tbody:2,
            tr:10
          }
        },
        radioactivityTesting:{
          action:'radioactivityTesting',
          flag:true,
          loading:false,
          notNumber:['isTest','irradiation','limit'],
          intNumber:[],
          like:false,
          table:{
            td:['5','1'],
            tbody:['5','3'],
            tr:10
          }
        },
        neutronBackground:{
          action:'neutronBackground',
          flag:true,
          loading:false,
          notNumber:['notes'],
          intNumber:[],
          like:false,
          table:{
            td:5
          }
        },
        thermoluminescentBackground:{
          action:'thermoluminescentBackground',
          flag:true,
          loading:false,
          notNumber:['notes','explain'],
          intNumber:[],
          like:true,
          table:{
            td:5,
            tr:3
          }
        },
        form:{
          beamLimitingDeviceXRay:{

          },
          electronBeamLimitingDevice:{

          },
          leakageRadiation:{

          },
          leakageRadiationOutside:{

          },
          radioactivityTesting:{

          },
          neutronBackground:{

          },
          thermoluminescentBackground:{

          }
        }
      }
    },
    watch:{
      activeTab:{
        handler(val) {
          this.$nextTick(()=>{
            if(val == 3){
              let resultId = this.basicForm.resultId;
              getInfoById(resultId).then(response => {
                if(response.code == 200){
                  let data = response.data;
                  for(let keys in data){
                    this.setData(keys,data[keys]);
                  }
                   setTimeout(()=>{
                     this.initFlag = true;
                   },300)
                }
              }).catch((response) => {
                 this.$emit("loadingchange", true);
               });
               }
            });
        },
        deep: true,
        immediate: true
      },
      "form.beamLimitingDeviceXRay":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'beamLimitingDeviceXRay');
         }
        },
        deep:true,
      },
      "form.electronBeamLimitingDevice":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'electronBeamLimitingDevice');
         }
        },
        deep:true,
      },
      "form.leakageRadiation":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'leakageRadiation');
         }
        },
        deep:true,
      },
      "form.leakageRadiationOutside":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'leakageRadiationOutside');
         }
        },
        deep:true,
      },
      "form.radioactivityTesting":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'radioactivityTesting');
         }
        },
        deep:true,
      },
      "form.neutronBackground":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'neutronBackground');
         }
        },
        deep:true,
      },
      "form.thermoluminescentBackground":{
        handler(newName, oldName) {
         if(this.initFlag){
          this.validateData(newName,'thermoluminescentBackground');
         }
        },
        deep:true,
      },
    },
    methods:{
      //修改数据
      setData(name,data){
        this.form[name] = data ? data : (this[name] ? {}:null);
      },
      //表单修改提交后端
       postForm(param,name){
         param['itemsId'] = this.form.itemsId;
         param['isTest'] = this.form.beamLimitingDeviceXRay.isTest;
         this.$emit("loadingchange", true);
      	 postInfo(param,this[name].action).then(res=>{
      		 this.$emit("loadingchange", false);
      		 if(res.code == 200){
      			 this[name].flag = false;
      			 if(name != 'sdd'){
      				this.setData(name,res.data);
      			 }
      		 }
      	 })
      },
      validateType(arr,keys,obj){
      	if(obj.like){
      		for(let i=0;i<arr.length;i++){
      			if(keys.indexOf(arr[i]) != -1){
      				return true;
      			}
      		}
      		return false;
      	}else{
      		if(arr.indexOf(keys) != -1){
      			return true;
      		}
      		return false;
      	}
      },
       //数据验证
       validateData(newName,myName){
      	 if(!this[myName].noClear){
      		clearTimeout(this[myName].loading);
      	 }else{
      		 this[myName].noClear = false;
      	 }
         let regNumber = /^[-]?\d*([.](\d+))?$/;//小数验证正则
         let regRepNumber = /[^-?\d.,]/g;//将除小数外的符号消除正则
         let regInt = /^\d*$/;//整数验证正则
         let regRepInt = /[^-?\d,]/g;//将除小数外的符号消除正则
         let reg,regRep;
         let repStr = '';
      	 let intResult
         if(JSON.stringify(newName) != '{}'){
           //遍历该对象所有字段进行验证
           for(let keys in newName){
             //数字验证环节
      			 if((typeof newName[keys] == 'string') ||  (typeof newName[keys] == 'number')){
      				if(newName[keys] && !this.validateType(this[myName].notNumber,keys,this[myName])){
      					intResult = this.validateType(this[myName].intNumber,keys,this[myName]);
      					reg = intResult ? regInt:regNumber;
      				  let bool = !reg.test(newName[keys]);
      				  if(bool){
      						setTimeout(()=>{
      							intResult = this.validateType(this[myName].intNumber,keys,this[myName]);
      							regRep = intResult ? regRepInt:regRepNumber;
      									repStr = newName[keys] + '';
      							repStr =  repStr.replace(regRep,'');
      							if(repStr != (newName[keys]+'')){
      								if(!this[myName].noClear){
      									this[myName].noClear = true;
      								}
      								newName[keys] = repStr;
      							}
      						},100);
      						if(this[myName].flag){
      						 this[myName].flag = false;//如果数字验证不通过不需要请求后端
      						}
      				  }
      				}
      			 }
           }
      		 this.isPost(newName,myName);
         }
       },
       isPost(newName,myName){
      	 if(this[myName].flag){//是否请求后端判断
      	  let postBody = {};
      	  for(let i in newName){
      	    if(newName[i] !== null && newName[i] !== undefined){
      	      postBody[i] = newName[i];
      	    }
      	  }
      	  if(JSON.stringify(postBody) != '{}'){
      			this[myName].loading = setTimeout(()=>{
      				this.postForm(postBody,myName);
      			},800)
      	  }
      	 }else{
      		 this[myName].flag = true;
      	 }
       },
    },
  }
</script>
<style lang="scss" scoped>
  @import '../content.scss';

  .miniFont {
    font-size: 10px;
  }

  .miniFontCenter {
    margin-top: 8px;
  }

  .content51 {
    padding-inline: 0 !important;
    ::v-deep .el-input__suffix{
      display: none;
    }
    .latex{
      margin-top: 15px;
    }
    table {
      width: 100%;

      td {
        max-width: 100px;

        ::v-deep .el-checkbox__label {
          white-space: break-spaces;
        }
      }

      .el-input {
        width: 100% !important;
      }

      .multipleInput {
        .el-input {
          width: 50px !important;
        }
      }
    }
    .input100 {
      .el-input {
        width: 100px !important;
      }
    }

    .innertitle {
      display: block;
      margin-left: 0;
    }

    .table1 {
      .el-radio {
        display: flex;
        align-items: center;
      }
    }

    #hearderTR td:nth-child(7) {
      display: none;
    }
  }
</style>
